//
//  Scene_tableViewCellNearO.m
//  EggSteward
//
//  Created by 王道林 on 16/9/3.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "Scene_tableViewCellNearO.h"
#import "Masonry.h"
#import "UIImageView+WebCache.h"
#import "ActionCycleModel.h"
@interface Scene_tableViewCellNearO ()
@property (nonatomic, strong) UIImageView *imageview;
@end

@implementation Scene_tableViewCellNearO

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)createSubView
{
    _imageview = [[UIImageView alloc] init];
    _imageview.image = [UIImage imageNamed:@"1203"];
    [self.contentView addSubview:_imageview];
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    [_imageview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.contentView.mas_top);
        make.left.mas_equalTo(self.contentView.mas_left);
        make.bottom.mas_equalTo(self.contentView.mas_bottom);
        make.right.mas_equalTo(self.contentView.mas_right);
    }];
    
}

- (void)setModel:(ActionCycleModel *)model
{
    _model = model;
    [_imageview sd_setImageWithURL:[NSURL URLWithString:_model.image] placeholderImage:[UIImage imageNamed:@"1203"]];
}


@end
